import React from "react";
import Layout from "../layout";
const Home = React.lazy(() => import("../views/home"));
const List = React.lazy(() => import("../views/list"));
const My = React.lazy(() => import("../views/my"));
const Set = React.lazy(() => import("../views/set"));
const Login = React.lazy(() => import("../views/login"));

export const menuRoutes = [
  {
    path: "/",
    element: <Home></Home>,
    meta: {
      title: "首页",
    },
  },
  {
    path: "/list",
    element: <List></List>,
    meta: {
      title: "列表",
    },
  },
  {
    path: "/my",
    element: <My></My>,
    meta: {
      title: "我的",
    },
  },
  {
    path: "/set",
    element: <Set></Set>,
    meta: {
      title: "设置",
      roles: ['admin']
    },
  },
];

export const routes = [
  {
    path: "/login",
    element: <Login></Login>,
  },
  {
    path: "/",
    element: <Layout></Layout>,
    children: menuRoutes,
  },
];
